package com.snopy.designPattern.create.singleton;

import lombok.extern.slf4j.Slf4j;

/**
 * @author snopy
 * @version 1.0.0
 * @classname Demo
 * @description
 * @email 77912204@qq.com
 * @date 2022/06/27 15:44
 */
@Slf4j
public class Demo {

    public static void main(String[] args) {
        /*try {
            Class<?> aClass = Class.forName("com.snopy.designPattern.singleton.SingletonA");
            Constructor<?> constructor = aClass.getDeclaredConstructor();
            constructor.setAccessible(true);
            SingletonA instance = (SingletonA) constructor.newInstance();
            log.info("无参私有构造:{}",instance);
        } catch (ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }*/
        SingletonB instance = SingletonB.INSTANCE;
        instance.doSomething();
    }
}
